﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Ttifa.Log;

namespace Ttifa.JobScheduler
{
    public partial class Service1 : ServiceBase
    {
        private FluentSchedulerDemo scheduler = null;
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            LogFactory.GetLogger().Info("服务已启动");

            scheduler = new FluentSchedulerDemo();
            Task.Run(() => { scheduler.Start(); });
        }

        protected override void OnStop()
        {
            scheduler.Stop();
            LogFactory.GetLogger().Info("服务已停止");
        }
    }
}
